package cn.itrip.auth.service;

import cn.itrip.beans.pojo.ItripUser;
/**
 * @author 瑾
 */
public interface UserService {
    /**
     * 邮箱————注册一条用户
     * 1.添加用户信息
     * 2 生成激活码、
     * 3 发送邮件、
     * 4 激活码存入Redis
     * @param itripUser
     * @throws Exception
     */
    public void itriptxCreateUserByEmail(ItripUser itripUser) throws  Exception;


    /**
     *   邮箱注册----更新用户以及激活码的验证
     * @param mail  收件人地址
     * @param code  激活码
     * @return
     * @throws Exception
     */
    public boolean activateEmail(String mail,String code) throws  Exception;


    /**
     *      手机短信码注册---
     * @param user
     * @throws Exception
     */

    public void itriptxCreateUserByPhnoe(ItripUser user) throws  Exception;


    /**
     *  验证手机短信码 ，更新用户激活的状态
     */
    public boolean validatePhone(String phone,String code) throws Exception;


    public ItripUser findUserByUserCode(String userCode) throws  Exception;
    public ItripUser login(String userCode,String userPassword) throws  Exception;
}
